<html>
<head><meta charset="utf-8"><title>regression: overflow evaluating, Send/Sync? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html">regression: overflow evaluating, Send/Sync?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167488050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167488050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167488050">(Jun 06 2019 at 14:45)</a>:</h4>
<blockquote>
<p>(presumably due to PR <a href="https://github.com/rust-lang/rust/issues/60444" target="_blank" title="https://github.com/rust-lang/rust/issues/60444">#60444</a>; the running hypothesis that niko and I share is that most instances of this are cases where the input code was unsound, and thus the fallout is expected. I don't think we can readily warning-cycle this change.)</p>
</blockquote>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span>  I don't see how my code could have been unsound...</p>



<a name="167488849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167488849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167488849">(Jun 06 2019 at 14:54)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> the code may be just fine, but the <strong>trait resolution algorithm</strong> was unsound</p>



<a name="167488856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167488856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167488856">(Jun 06 2019 at 14:54)</a>:</h4>
<p>i.e., it permitted things that could be used to go wrong</p>



<a name="167488922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167488922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167488922">(Jun 06 2019 at 14:55)</a>:</h4>
<p>that said, if you have a minimized version of your code...</p>



<a name="167489041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489041">(Jun 06 2019 at 14:56)</a>:</h4>
<p>I rather assume that the problem is that the structs are very deep, so minimal might be hard</p>
<p><a href="https://crater-reports.s3.amazonaws.com/beta-1.36-2/beta-2019-05-30/reg/fuzzy-pickles-0.1.0/log.txt" target="_blank" title="https://crater-reports.s3.amazonaws.com/beta-1.36-2/beta-2019-05-30/reg/fuzzy-pickles-0.1.0/log.txt">https://crater-reports.s3.amazonaws.com/beta-1.36-2/beta-2019-05-30/reg/fuzzy-pickles-0.1.0/log.txt</a></p>



<a name="167489096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489096">(Jun 06 2019 at 14:57)</a>:</h4>
<p>fuzzy-pickles is a Rust parser, so the AST types are nested</p>



<a name="167489299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489299">(Jun 06 2019 at 14:59)</a>:</h4>
<p>I could try with something like <code>struct A0(A1);</code> repeated for N=500; or such.</p>



<a name="167489602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489602">(Jun 06 2019 at 15:01)</a>:</h4>
<p>I think fuzzy-pickles did work once we increased the overflow counter?</p>



<a name="167489611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489611">(Jun 06 2019 at 15:02)</a>:</h4>
<p>still, hmm, I am looking at some improved caching,</p>



<a name="167489661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489661">(Jun 06 2019 at 15:02)</a>:</h4>
<p>I wonder if that might actually affect the value of the recursion counter too</p>



<a name="167489667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489667">(Jun 06 2019 at 15:02)</a>:</h4>
<p>I suppose it would</p>



<a name="167489680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489680">(Jun 06 2019 at 15:02)</a>:</h4>
<p>if only we had a chalk like system which has no recursion counter</p>



<a name="167489683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489683">(Jun 06 2019 at 15:02)</a>:</h4>
<p>/me someday</p>



<a name="167489754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167489754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167489754">(Jun 06 2019 at 15:03)</a>:</h4>
<p>My gut says that some caching would help, or an iterative solution instead of recursive?</p>



<a name="167490172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167490172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167490172">(Jun 06 2019 at 15:08)</a>:</h4>
<blockquote>
<p>I think fuzzy-pickles did work once we increased the overflow counter?</p>
</blockquote>
<p>yes, that is what I found at least.</p>



<a name="167490461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167490461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167490461">(Jun 06 2019 at 15:10)</a>:</h4>
<p>I added a repro, but 63 nested structs will trigger the overflow</p>



<a name="167490648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/regression%3A%20overflow%20evaluating%2C%20Send/Sync%3F/near/167490648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/regression.3A.20overflow.20evaluating.2C.20Send.2FSync.3F.html#167490648">(Jun 06 2019 at 15:12)</a>:</h4>
<p>In my case, I also have things like <code>Vec</code> which count as 3 types</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>